﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;

namespace Zatify.API.Controllers
{
    public class CategoryController : BaseController
    {
        public string GetAll(string token)
        {
            try
            {
                //if (!CommonLib.UserCheckToken(token))
                //    return CommonLib.ErrorXml("Invalid token", "1").ToString();

                DataTable dt = DataAccess.GetDataTable("spAPI_Category_GetAll");
                return CommonLib.OkXml(new string[] { "Data" }, new string[] { dt.Rows[0]["Result"].ToString() }).ToString();
            }
            catch (Exception ex)
            {
                return CommonLib.ErrorXml(ex.Message, "100").ToString();
            }
        }
        
    }
}
